﻿#pragma once

#include "proto_common_skill.pb.h"
#include "NFServerComm/NFServerCommon/NFIDescStoreEx.h"
#include "NFServerComm/NFServerCommon/NFIDescTemplate.h"
#include "NFComm/NFObjCommon/NFResDb.h"
#include "NFComm/NFObjCommon/NFShmMgr.h"
#include "NFComm/NFShmStl/NFShmHashMap.h"
#include "NFComm/NFShmStl/NFShmVector.h"
#include "NFLogicCommon/NFDescStoreTypeDefines.h"

const int MAX_SKILL_SLOT_DESC_NUM = 9;
const int MAX_EX_SKILL_SLOT_NUM = 2;

inline bool IS_VALID_SKILL_SLOT(int iSlot)
{
    return iSlot > 0 && iSlot <= MAX_SKILL_SLOT_DESC_NUM;
}

class SkillDescEx : public NF_OBJECT_GLOBAL_TEMPLATE_MACRO(SkillDescEx, EOT_CONST_SKILL_DESC_EX_ID, NFIDescStoreEx)
public:
    SkillDescEx();

    virtual ~SkillDescEx();

    int CreateInit();

    int ResumeInit();

public:
    virtual int Load() override;

    virtual int CheckWhenAllDataLoaded() override;

public:
    int GetExSkillSlotNum() const { return m_iExSkillSlotIndex.size(); }

    int GetExSkillSlot(int iIdx) const;

private:
    bool IS_VALID_SLOT_TYPE(int iType)
    {
        return iType >= proto_ff::EN_SKILL_SLOT_TYPE_NORMAL && iType <= proto_ff::enSkillSlotType_MAX;
    }

private:
    NFShmVector<int, MAX_SKILL_SLOT_DESC_NUM> m_iExSkillSlotIndex;
};
